const express = require("express");
const mysql = require('mysql');

const app = express();
app.use(express.static("www"));


const mysqli = mysql.createConnection({
    host: "localhost",//ip
    user: "root",//用户名
    password: "root",//密码
    database: "xiaomi" // 要连接的数据库名称
})

mysqli.connect(function (err) {
    if (err) {
        console.log("连接数据库失败");
        
    }else{
        console.log("连接数据库成功");
     
    }
})




app.listen(3000, () => {
    console.log("localhost:3000");
})